Disable is_on_nfs_mount() check on musl libc (fixes #2937)
authorJakub Jirutka <jakub@jirutka.cz>
Sun, 7 Aug 2016 00:22:00 +0000 (02:22 +0200)
committerJakub Jirutka <jakub@jirutka.cz>
Sun, 7 Aug 2016 00:25:34 +0000 (02:25 +0200)
musl libc doesn't provide constant NFS_SUPER_MAGICK that is used in
the is_on_nfs_mount function.

src/cargo/util/flock.rs

index cccdd4aad87171bdbe335762e3f72aa45d457952..3e4530b56eb3e9b3c7d0850d1be0608ac33ddd11 100644 (file)
@@ -291,7 +291,7 @@ fn acquire(config: &Config,
         human(format!("failed to lock file: {}", path.display()))
     });
 
-    #[cfg(target_os = "linux")]
+    #[cfg(all(target_os = "linux", not(target_env = "musl")))]
     fn is_on_nfs_mount(path: &Path) -> bool {
         use std::ffi::CString;
         use std::mem;
@@ -310,7 +310,7 @@ fn acquire(config: &Config,
         }
     }
 
-    #[cfg(not(target_os = "linux"))]
+    #[cfg(any(not(target_os = "linux"), target_env = "musl"))]
     fn is_on_nfs_mount(_path: &Path) -> bool {
         false
     }